<template>
  <div class="handle">
    <div class="handle_box">
      <el-menu
          :default-active=active
          class="el-menu-demo"
          mode="horizontal"
          router
      >
        <el-menu-item index="/borrow-copy">借款</el-menu-item>
        <el-menu-item index="/back-copy">还款</el-menu-item>
      </el-menu>
      <router-view></router-view>
    </div>
  </div>
</template>

<script setup>
import {ElMenu, ElMenuItem} from "element-plus"
import {onMounted, ref} from "vue"
import {useRouter} from "vue-router"
import emitter from "@/lib/eventBus"


const active = ref('/borrow-copy')
const router = useRouter()

emitter.on('updateMySeal',(key)=>{
  active.value = key
})

onMounted(()=>{
  emitter.emit('home_menu','/borrow-copies')
  router.push('/borrow-copy')
})
</script>

<style scoped lang="less">
.handle{
  height: 97vh;
  width: 90vw;
  margin-left: 9vw;
  margin-top: 1vh;
  border-radius: 10px;
  background-color: rgba(249, 249, 249);
  .handle_box{
    width: 99%;
    margin: .5vh auto 0 auto;
  }
}
</style>
